home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK2.toast / Development Kits (Disc 2) / ScriptX / Code Samples / autofind / source / autogrph.sx < prev    next >
Encoding:
Text File  |  1996-05-21  |  2.2 KB  |  77 lines  |  [TEXT/ttxt]

  1. --<<<
  2. -- Filename: 
  3. --     autogrph.sx
  4.  
  5. -- Other Files Required:
  6. --     grapher.sx, grphclab.sx, grphmenu.sx, modelcar.sx
  7.  
  8. -- Purpose:  
  9. --     Sets up a Grapher oriented for automobile selection
  10.  
  11. -- Specialized Classes:  
  12. --     None
  13.  
  14. -- Instructions to User: 
  15. --     None
  16.  
  17. -- Author:
  18. --     Dionn Stewart, Steve Mayer, Ray Davis
  19. in module Autofinder
  20.  
  21. if (not isDefined Grapher) do fileIn theScriptDir name:"grapher.sx"
  22. if (not isDefined Axis) do fileIn theScriptDir name:"axis.sx"
  23. if (not isDefined GraphicLabel) do fileIn theScriptDir name:"grphclab.sx"
  24. if (not isDefined GrapherMenu) do fileIn theScriptDir name:"grphmenu.sx"
  25. if (not isDefined ModelCar) do fileIn theScriptDir name:"modelcar.sx"
  26.  
  27. class AutoGrapher (Grapher)
  28. instance variables
  29.     dropspace            -- area to drop modelcars in to add to queryList
  30. --    queryList               -- List of car names to query database with
  31. --    blackCurtain        -- blackCurtain screen for introduction
  32. end
  33.  
  34. method init self {class AutoGrapher} #rest args #key media: ->
  35. (
  36.     local labelFont, labelFontChanges
  37.     local xAxis, YAxis, propMenu, background
  38.  
  39.     -- Set the text attributes.
  40.     labelFont := new PlatformFont name:"Palatino"
  41.     labelFontChanges := \
  42.         #(@font:labelFont, @size:18, @alignment:@center, \
  43.             @leading:20, @brush:whiteBrush)
  44.     
  45.     xAxis := new Axis origin:135 length:450 \
  46.         axLabel:(new GraphicLabelButton background:media["xlabel"] \
  47.             hmarg:9 vmarg:10 fontChanges:labelFontChanges)
  48.     labelFontChanges[@indent] := 6
  49.     yAxis := new Axis origin:405 length:300 \
  50.         axLabel:(new GraphicLabelButton background:media["ylabel"] \
  51.             hmarg:10 vmarg:15 fontChanges:labelFontChanges)
  52.     propMenu := new GrapherMenu background:media["menu"] \
  53.         fontChanges:(#(@size:20, @alignment:@center, @leading:20, @font:labelFont))
  54.  
  55.     apply nextMethod self background:media["graph"] \
  56.         xAxis:xAxis yAxis:yAxis \
  57.         propertyMenu:propMenu propertyList:ModelCar.axisProperties \
  58.         travelDuration:12 args
  59.  
  60.     placeLabels self
  61.     self
  62. )
  63.  
  64. method afterinit self {class AutoGrapher} #rest args ->
  65. (
  66.     apply nextMethod self args
  67.     
  68.     -- Add the junkyard dropspace
  69.     -- The drop space is the area on the grapher where the model cars can be
  70.     -- dropped to be removed from the current selection list
  71.     self.dropspace:= new Rect x1:460 y1:430 x2:640 y2:480
  72.     self
  73. )
  74.  
  75. "Compiled autogrph.sx"
  76. -->>>
  77.